<?php
namespace app\index\validate;

use think\Validate;

class CrmManage extends Validate
{
	protected $rule = [
		'username'=>'require|unique:crm_manage',
		'name'=>'require',
		'password'=>'require|length:6,12|confirm:chkpass',
		'group_id'=>'>:0',
		'zu_id'=>'>:0',
	];

	protected $message = [
		'name.require'=>'姓名不能为空',
		'username.require'=>'用户名不能为空',
		'username.unique'=>'该用户名已经存在',
		'password.require'=>'密码不能为空',
		'password.length'=>'密码长度在5-12位之间',
		'password.confirm'=>'密码不一致',
		'group_id'=>'请选择权限角色',
		'zu_id'=>'请选择组别',
	];

	protected $scene = [
		'add'=>['name','username','password','group_id','zu_id'],
		'edit'=>['name','username','group_id','zu_id'],
	];
}

?>